<script setup>
import { onMounted, ref } from 'vue'
import { useAudioStore } from '@/stores/audioStore.js'

const audio = ref(null)
const useAudio = useAudioStore()
onMounted(() => {
  useAudio.getAudio(audio)
  useAudio.listenerPlay()
  useAudio.listenerTimeUpdate()
  useAudio.listenerPause()
  useAudio.listenerEnded()
  useAudio.listenerCanplaythrough()
})

</script>

<template>
  <audio :src="useAudio.songResult.url" autoplay ref="audio"></audio>
  <RouterView />
</template>

<style scoped></style>
